#pragma once

#include <optional>
#include "Containers/Containers.h"
#include "ScriptCompiler/AST/ASTNode.h"

class CUsingNode;
class CScriptToken;
class CClassNode;
class CDelegateNode;
class CEnumNode;


class CNamespaceNode : public CASTNode
{
public:
    CNamespaceNode(std::weak_ptr<CScriptFileContext> InFile)
        : CASTNode( InFile,EASTNodeType::Namespace)
    {
    }

    std::shared_ptr<CScriptToken> Namespace;

    //name of namespace, might be nested, such as "namespace A.B.C {}", then NameChain is [A,B,C]
    TVector<std::shared_ptr<CScriptToken>> NameChain;

    TVector<std::shared_ptr<CUsingNode>>  Usings;

    TVector<std::shared_ptr<CNamespaceNode>> Namespaces;

    //classes/structs/interfaces
    TVector<std::shared_ptr<CClassNode>> Classes;

    TVector<std::shared_ptr<CDelegateNode>> Delegates;

    TVector<std::shared_ptr<CEnumNode>> Enums;


    virtual void DebugPrint(int32_t InDepth) override;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() override { return Namespace; }
};